n = 5
matrix = [[0 for j in range(n)] for i in range(n)]
count = 1
'''for i in range(1, x2+1):
    z = []
    for j in range(1, x2+1):
        z.append(j)
    n.append(z)
x = x - 1'''

for step in range(n//2):
    for i in range(step, n-step-1):
        matrix[step][i] = count
        count += 1
    for i in range(step, n-step-1):
        matrix[step][i-1] = count


print (matrix)

for i in matrix:
    print (i, end='\n')
    #print ('%2d'%i, end='\n')

